<?php

/*
 * PHP version 5
 * Copyright (c) 2002-2012 yisu.cn
 * 声明：这不是一个免费的软件，请在许可范围内使用
 * 作者：Mr.Aaron E-mail:zhuchao.zc@163.com QQ:2980764002
 */

class mainpage extends connector
{

    function mainpage()
    {


        $this->softbase(false);
    }

    function in_check()
    {
        die('222');

        header("Access-Control-Allow-Origin:*");

        if ($_GET['token'] != 'KSD93-1KESD4012JSSskK9303483934') {
            die('error');
        }


        $domain_name = $_GET['url'];


        // $arr = [];
        // $domain_name = htmlspecialchars($_POST['url']);

        // if( !filter_var('HTTP://'.$domain_name, FILTER_VALIDATE_URL)){
        //     $arr = ['status' => 2,'msg' => '参数错误'];
        //     return json_encode($arr);
        //     }
        //

        //
        $data = $this->db->query('SELECT * FROM `db_domain_name` WHERE `domain_name` = ' . $domain_name . ' AND `End_Time` > ' . time() . ' LIMIT 1');
        $result = $this->db->fetch_row($data);
        var_dump($result);
        die;

        if (!$result) {
            $arr = ['status' => 2, ',msg' => '未授权'];
            return json_encode($arr);
        }

        if (strtotime($result['end_time']) > time()) {
            $arr = ['status' => 1, ',msg' => '已授权'];
            return json_encode($arr);
        }

        $arr = ['status' => 3, ',msg' => '授权过期'];
        return json_encode($arr);


    }

}

?>